﻿@model Wicresoft.SelfService.DAO.ServiceDetail
<tr>
    <td colspan="4">
        <table id="tblAttachments" cellpadding="4" cellspacing="0" border="1px">
            <thead>
                <tr>
                    <th>
                        文件名
                    </th>
                    <th>
                        文件大小(KB)
                    </th>
                    <th>
                        上传时间
                    </th>
                    <th>
                        提交人
                    </th>
                    <th>
                        操作
                    </th>
                </tr>
            </thead>
            <tbody>
                @if (Model.attachments != null)
                {
                    foreach (Wicresoft.SelfService.DAO.Attachment att in Model.attachments)
                    {   
                    <tr>
                        <td>
                            <a href="/ITService/downAttachment?folder=@Model.serviceRequestID&&fileName=@att.fileName" >@att.fileName</a>
                        </td>
                        <td>@att.fileSize
                        </td>
                        <td>@att.uploadDate.ToShortDateString()
                        </td>
                        <td>@att.committerUserName
                        </td>
                        <td>
                            @if (att.committerID == System.Web.HttpContext.Current.User.Identity.Name && Model.actions.Contains(Wicresoft.SelfService.DAO.actionType.uploadFile))
                            {
                                <a href='javascript:void(0)' id='@Model.serviceRequestID|@att.fileName' class='delAttachment'>
                                    删除</a>
                            }
                        </td>
                    </tr>
                    }
                }
            </tbody>
        </table>
    </td>
</tr>
@if (Model.actions.Contains(Wicresoft.SelfService.DAO.actionType.uploadFile))
{
    <tr>
        <td class="file-box">
            <input type="file" name="fileField" class="file" id="fileField" />
        </td>
        <td class="file-box">
            <input type="button" name="button" class="uploadBtn" value="上传" />
        </td>
    </tr>
    <tr>
        <td colspan="4">
            <p id="uploadFileQueue">
            </p>
            <p class="fontred">支持上传的文件格式：jpg; gif; png; txt; doc; docx; xls; xlsx; pdf; zip;rar;7z;pptx</p>
            <p class="fontred">文件大小不超过4M。</p>
        </td>
    </tr>
}
